Core.Test.registerTest({
	group: "utils",
	name: "String",
	
	"Should capitalize the given string": function() {
		Assert.equal("Aa", "aa".capitalize());
		Assert.equal("Aa", "Aa".capitalize());
		Assert.equal("Ania has a cat", "ania has a cat".capitalize());
	},
	
	"Should contain the existing substring": function() {
		Assert.yes("word".contains("w"));
		Assert.yes("word".contains("or"));
		Assert.yes("word".contains("ord"));
		Assert.yes("word".contains("word"));
	},
	
	"Shouldn't contain unexisting substring": function() {
		Assert.no("word".contains(/od/));
		Assert.no("word".contains(/subword/));
	},
	
	"Should be empty if contains no characters": function() {
		Assert.yes("".empty());
		Assert.no("aa".empty());
	},
	
	"Should left pad with spaces to the specified length": function() {
		Assert.equal("   w", "w".lpad(4));
		Assert.equal("  wo", "wo".lpad(4));
		Assert.equal(" wor", "wor".lpad(4));
		Assert.equal("word", "word".lpad(4));
		Assert.equal("subword", "subword".lpad(4));
	},
	
	"Should right pad with spaces to the specified length": function() {
		Assert.equal("w   ", "w".rpad(4));
		Assert.equal("wo  ", "wo".rpad(4));
		Assert.equal("wor ", "wor".rpad(4));
		Assert.equal("word", "word".rpad(4));
		Assert.equal("subword", "subword".rpad(4));
	},
	
	"Should pop last tokenized substring from the String": function() {
		Assert.equal("3", "1.2.3".pop());
		Assert.equal("3", "1-2-3".pop("-"));
		Assert.equal(".3", "1-.2-.3".pop("-"));
		Assert.equal("1-.2-.3", "1-.2-.3".pop("/"));
	},
	
	"Should shift first tokenized substring from the String": function() {
		Assert.equal("1", "1.2.3".shift());
		Assert.equal("1", "1-2-3".shift("-"));
		Assert.equal("1.", "1.-2.-3".shift("-"));
		Assert.equal("1.-2.-3", "1.-2.-3".shift("/"));
	},
	
	"Should trim the given string": function() {
		Assert.equal("word", "word ".trim());
		Assert.equal("word", " word ".trim());
		Assert.equal("word", " word  ".trim());
		Assert.equal("word", "word".trim());
		Assert.equal("word", " word".trim());
		Assert.equal("word", "  word".trim());
	},
	
	"Should indicate if the string starts with the specified prefix": function() {
		Assert.yes("subword".startsWith("sub"));
		Assert.no("subword".startsWith("word"));
	}
	
});